package Objects;

public class PendingMessage 
{	
	//***************************************Class Variables*******************************************//
	private static int available_id = 0;
	
	private String _from_android_id;
	private String _to_android_id;
	private String _message_content;
	private int _message_id;

	//***************************************Constructors*******************************************//

	public PendingMessage(String from_android_id, String to_android_id, String message)
	{
		this._from_android_id = from_android_id;
		this._to_android_id = to_android_id;
		this._message_content = message;
		this._message_id = getNextId(); // we are giving the message a unique id
	}

	//***************************************Public Methods*******************************************//

	
	public String get_from_android_id() 
	{
		return _from_android_id;
	}
	

	public String get_to_android_id() 
	{
		return _to_android_id;
	}
	
	
	public String get_message_content() 
	{
		return _message_content;
	}
	
	
	public int get_message_id()
	{
		return _message_id;
	}
	
	
	//***************************************Private Methods*******************************************//

	
	//we can change it in the future! because it will not be good for too many messages in the system
	private synchronized int getNextId()
	{
		available_id++; //we should now increase this parameter because we already used it
		return available_id;
	}
	
	
}
